package com.gzr.collection.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Teacher implements Comparable<Teacher>{

    private String name;
    private int age;
    private double salary;

    @Override
    public int compareTo(Teacher o) {
        return this.getAge() - o.getAge();//升序
    }
}
